<template>
    <div class='index'>
        <van-sticky>
        <van-nav-bar title="积云商城" left-text="返回" left-arrow @click-left="onClickLeft" />
        </van-sticky>
        <transition name="slide" mode="out-in">
        <router-view></router-view>
        </transition>
        
        <van-tabbar route>
            <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
            <van-tabbar-item icon="search" to="/list">分类</van-tabbar-item>
            <van-tabbar-item icon="friends-o" to="/shopcar">购物车</van-tabbar-item>
            <van-tabbar-item icon="search" to="/search">搜索</van-tabbar-item>
            <van-tabbar-item icon="setting-o" to="/my">我的</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
    export default {
        data() {
            return {};
        },
        mounted() {},
        methods: {
            onClickLeft() {
                this.$router.go(-1)
            }
        },
    };
</script>

<style lang='scss'>
.slide-enter{
    transform: translateX(100%);
}
.slide-leave-to{
    transform: translateX(-100%);
}
.slide-enter-to,slide-leave{
    transform: translateX(0px);
}
.slide-enter-active,
.slide-leave-active{
    transition: all 1s;
}
</style>